import { Config } from '../../utils/config.js';

Page({
  data: {
    link:"",
  },

  onLoad:function(e){
    wx.showLoading({
      title: '加载中',
    });
    var that = this;
    console.log(e)
    console.log(e.fpqqlsh)
    var dzfppdf = e.dzfppdf  //电子发票pdf
    var fpqqlsh = e.fpqqlsh  //发票流水号

    that.setData({
      fpqqlsh: fpqqlsh
    })

    wx.request({
      url: Config.restUrl + 'feedback/DownloadInvoice?fpqqlsh=' + e.fpqqlsh,
      data: {},

      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: function(res) {
     
        that.setData({
          link: Config.restUrl + 'feedback/DownloadInvoice?fpqqlsh=' + e.fpqqlsh,
        });
        wx.hideLoading();
      },
      fail: function(res) {},
      complete: function(res) {},
    })

    
  },
  click_img(e){
    let that=this;
    wx.previewImage({
      current: Config.restUrl + 'feedback/DownloadInvoice?fpqqlsh=' + that.data.fpqqlsh,
      urls: [Config.restUrl + 'feedback/DownloadInvoice?fpqqlsh=' + that.data.fpqqlsh],
    })
  }

})
